package com.bw.mvp.V;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.bw.mvp.P.InitPretenter;

/**
 * create by ertu
 * create on 2021/9/9
 * description
 */
public abstract class BannerFragment <P extends InitPretenter> extends Fragment implements InitFragment ,InitView {
    protected P plis;
    private View view;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return view =inflater.inflate(bandLayoud(),container,false);
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        initView();
        initDate();
    }

    @Override
    public void showLayout() {

    }

    @Override
    public void haidLayout() {

    }

    @Override
    public void tostLayout(String name) {

    }


    @Override
    public <T extends View> T findViewById(int id) {
        return view.findViewById(id);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        if (plis!=null)
        {
            plis=null;
            plis.diserPretenter();
        }
    }
}
